import React, { Component } from "react"
import { BrowserRouter, Route, Redirect, Switch } from "react-router-dom"
import Loadable from "react-loadable"
import loading from "./routes/Loading"
const IndexPage = Loadable({
  loading,
  loader: () => import("./routes/IndexPage")
})
const NotFound = Loadable({
  loading,
  loader: () => import("./routes/404")
})

export default class App extends Component {
  render() {
    return (
      <BrowserRouter>
        <switch>
          <Route path="/" component={IndexPage} exact />
          <Route path="/404" component={NotFound} exact />
          <Redirect to="/404" />
        </switch>
      </BrowserRouter>
    )
  }
}
